<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <base href="__STATIC__/hou/" >
<link href="" rel="stylesheet" type="text/css" />
<link href="styles/main.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
  color: white;
}
</style>

</head>
<body style="background: #278296">
<form method="post" action="privilege.php" name='theForm'>
  <table cellspacing="0" cellpadding="0" style="margin-top: 100px" align="center">
  <tr>
    <td><img src="images/login.png" width="178" height="256" border="0" alt="ECSHOP" /></td>
    <td style="padding-left: 50px">
      <table>
      <tr>
        <td>管理员姓名：</td>
        <td><input type="text" name="u_name" /></td>
      </tr>
      <tr>
        <td>管理员密码：</td>
        <td><input type="password" name="u_pwd" /></td>
      </tr>
      <tr>
        <td>验证码：</td>
        <td><input type="text" name="yzm" class="capital" /></td>
      </tr>
      <tr>
      <td colspan="2" align="right"><img src="{:captcha_src()}" width="160" height="50" alt="CAPTCHA" border="1" onclick= this.src="{:captcha_src()}" style="cursor: pointer;" title="看不清？点击更换另一个验证码。" />
      </td>
      </tr>
      <tr><td colspan="2"><input type="checkbox" value="1" name="remember" id="remember" /><label for="remember">请保存我这次的登录信息</label></td></tr>
      <tr><td>&nbsp;</td><td><input type="button" value="进入管理中心" id="button" /></td></tr>
      <tr>
        <td colspan="2" align="right">&raquo; <a href="../" style="color:white">返回首页</a> &raquo; <a href="get_password.php?act=forget_pwd" style="color:white">你忘记了密码吗？</a></td>
      </tr>
      </table>
    </td>
  </tr>
  </table>
  <input type="hidden" name="act" value="signin" />
</form>

</body>
<script src="__STATIC__/qian/js/jquery.js"></script>
<script>
  $('#button').click(function(){
    var u_name=$('input[name=u_name]').val();
    var u_pwd=$('input[name=u_pwd]').val();
    var yzm=$('input[name=yzm]').val();
    $.ajax({
      url:"{:url('Index/dologin')}",
      data:{u_name:u_name,u_pwd:u_pwd,yzm:yzm},
      dataType:"json",
      type:"post",
      success:function(result){
        if(result.code==0){
          alert(result.msg);
          return false;
        }else if(result.code==1){
          alert(result.msg);
          return false;
        }else{
          window.location.href="{:url('First/index')}";
        }
      },
      error:function(){
          alert('请求错误')
      }
    })
  })
</script>